#ifndef N2WORLDTRANSFORM_H_2009_11_02
#define N2WORLDTRANSFORM_H_2009_11_02

#include "N1Lib.h"
#include "N2Defs.h"
#include "N2Geometry.h"

/***************************************************************

x' = x * eM11 + y * eM21 + eDx
y' = x * eM12 + y * eM22 + eDy

***************************************************************/

class N2WorldTransform {
public:
    FLOAT   eM11;  //scale_by_X * cos( rotation_angle )
    FLOAT   eM12;  //scale_by_X * sin( rotation_angle )
    FLOAT   eM21;  //- scale_by_Y * sin( rotation_angle )
    FLOAT   eM22;  //scale_by_Y * cos( rotation_angle )
    FLOAT   eDx;   //offset by X
    FLOAT   eDy;   //offset by Y

public:
    N2WorldTransform();

#ifdef WINDOWS
    N2WorldTransform(const XFORM &xf);
    XFORM getXFORM() const ;
#endif

    void setOffset(FLOAT dx, FLOAT dy);

    void getOffset(FLOAT &dx, FLOAT &dy);

    void modify(N2Coord &x, N2Coord &y) const ;
};

#endif //N2WORLDTRANSFORM_H_2009_11_02
